# Contributor: Alisa <corg@disroot.org>
# Contributor: Maxim Karasev <begs@disroot.org>
# Maintainer: Alisa <corg@disroot.org>
pkgname=gamescope
pkgver=3.11.30
_stb=af1a5bc352164740c1cc1354942b1c6b72eacb8a
pkgrel=2
pkgdesc="SteamOS session compositing window manager"
url="https://github.com/Plagman/gamescope"
arch="all"
license="BSD-2-Clause"
makedepends="
	glslang-dev
	libcap-dev
	libliftoff-dev
	libx11-dev
	libxcomposite-dev
	libxrender-dev
	libxres-dev
	libxtst-dev
	libxxf86vm-dev
	meson
	sdl2-dev
	vulkan-loader-dev
	wayland-protocols
	wlroots-dev
	xwayland-dev
	"
source="https://github.com/Plagman/gamescope/archive/refs/tags/$pkgver/gamescope-$pkgver.tar.gz
	https://github.com/nothings/stb/archive/$_stb/stb-$_stb.tar.gz
	system-wlroots-libliftoff.patch
	"
options="!check" # no tests

[ "$CARCH" = "riscv64" ] && options="$options textrels"

prepare() {
	default_prepare

	ln -sfv "$srcdir"/stb-$_stb "$builddir"/subprojects/stb
	cp "$builddir"/subprojects/packagefiles/stb/meson.build \
		"$builddir"/subprojects/stb
}

build() {
	abuild-meson build
	meson compile -C build
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C build
}

sha512sums="
a04d4d3fbbfc921dfeec6f00b28378fabcdcae86a6362a5c08a0813629ccf8bb0e7cf8812b5f86fccbc958aefa061c8f58b8bffd249ade3473d56fbce19a9704  gamescope-3.11.30.tar.gz
5937baa1a9b7342ddc0e41c37ba0ea6b0c878f670a81b55bb124681e6b5e381fdc1d9557c96637e3ba082d6d968ed67a78b47f16aa5555c1c43394d1f9e57f2d  stb-af1a5bc352164740c1cc1354942b1c6b72eacb8a.tar.gz
9fea6675d8c29d740c77d9ce6b69da4a1f54f39bf7a372fe538f154bb97f5cc21436033eeab1f2a154c5aee04410e5194b779c33104ab78b1a8a84ca5d798be2  system-wlroots-libliftoff.patch
"
